#!/usr/bin/env python
# -*- coding: utf-8 -*-

import tempfile
s='测试字符串'
temp=tempfile.TemporaryFile()
print>>temp,s

temp.seek(0)
s1=temp.read()
print s1